<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			//存储/修改数据
			localStorage.username = "张三"
			localStorage.setItem("age","18")
			
			//读取数据
			console.log(localStorage.getItem("username"))
			console.log(localStorage.age)
			
			//删除数据
			localStorage.removeItem("age")//删除一条
			localStorage.clear()//删除所有
			
			//按照所有获取数据
			//对象中的键值对，是没编号的，顺序也是我们看不到的(hash排序)
			console.log(localStorage.key(0))
		</script>
	</body>
</html>
